﻿using EkStudio.com.bean.xml.reflection;
using EkStudio.com.bean.xml.Unit;
using System;

namespace EkStudio.com.bean.xml.RootInterface.Field
{
    public class BillUiFieldsDataProperty :BillObjectInterface
    {
        private string editType = BeanUtil.FIELD_EDITTYPE_VALUE;

        private string comboType;

        private bool multiSelect;

        private string dataType = BeanUtil.FIELD_DATATYPE_VALUE;

        private int size = 100;

        private string dataSource = "";

        private bool fnNotNull = false;

        private bool fnDistinct = false;

        private bool virtualType = false;

        private string dtFormat = "";

        private string memory = BeanUtil.MEMORY_TYPE_VALUE;

        private BillUiFieldsItem parent;

        [Xml("editType")]
        public string EditType
        {
            get
            {
                return editType;
            }

            set
            {
                editType = value;
            }
        }
        [Xml("comboType")]
        public string ComboType
        {
            get
            {
                return comboType;
            }

            set
            {
                comboType = value;
            }
        }
        [Xml("multiSelect")]
        public bool MultiSelect
        {
            get
            {
                return multiSelect;
            }

            set
            {
                multiSelect = value;
            }
        }
        [Xml("dataType")]
        public string DataType
        {
            get
            {
                return dataType;
            }

            set
            {
                dataType = value;
            }
        }
        [Xml("size")]
        public int Size
        {
            get
            {
                return size;
            }

            set
            {
                size = value;
            }
        }
        [Xml("dataSource")]
        public string DataSource
        {
            get
            {
                return dataSource;
            }

            set
            {
                dataSource = value;
            }
        }
        [Xml("fnNotNull")]
        public bool FnNotNull
        {
            get
            {
                return fnNotNull;
            }

            set
            {
                fnNotNull = value;
            }
        }
        [Xml("fnDistinct")]
        public bool FnDistinct
        {
            get
            {
                return fnDistinct;
            }

            set
            {
                fnDistinct = value;
            }
        }
        [Xml("virtual")]
        public bool VirtualType
        {
            get { return virtualType; }
            set { virtualType = value; }
        }

        [Xml("dtFormat")]
        public string DtFormat
        {
            get
            {
                return dtFormat;
            }

            set
            {
                dtFormat = value;
            }
        }
        [Xml("memory")]
        public string Memory
        {
            get
            {
                return memory;
            }

            set
            {
                memory = value;
            }
        }
        [XmlTransient]
        public object ParentBean
        {
            get
            {
                return parent;
            }

            set
            {
                if(value is BillUiFieldsItem)
                    this.parent = (BillUiFieldsItem)value;
            }
        }

        public object Clone()
        {
            BillUiFieldsDataProperty clone = new BillUiFieldsDataProperty();
            clone.EditType = this.editType;
            clone.ComboType = this.comboType;
            clone.MultiSelect = this.multiSelect;
            clone.DataType = this.dataType;
            clone.Size = this.size;
            clone.DataSource = this.dataSource;
            clone.FnNotNull = this.fnNotNull;
            clone.FnDistinct = this.fnDistinct;
            clone.DtFormat = this.dtFormat;
            clone.Memory = this.memory;

            return clone;
        }


        
    }
}
